package com.yuju.controller.group;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.yuju.common.PageModel;
import com.yuju.common.Result;
import com.yuju.common.fileld.validator.FieldValidator;
import com.yuju.controller.base.BaseController;
import com.yuju.enums.ReturnCodeEnum;
import com.yuju.enums.ReturnStatusEnum;
import com.yuju.group.enums.GroupReturnCodeEnum;
import com.yuju.group.enums.LogBizRecordCodeEnum;
import com.yuju.group.enums.LogBizTypeCodeEnum;
import com.yuju.log.model.LogBizRecordModel;
import com.yuju.log.model.LogBizTypeModel;
import com.yuju.log.service.ILogBizRecordService;
import com.yuju.log.service.ILogBizTypeService;
import com.yuju.order.service.IRoomOrderService;
import com.yuju.util.Utils;
import com.yuju.vo.group.LogBizRecordVO;
import com.yuju.vo.group.LogBizTypeVO;
/**
 * 
 * 类名：GroupController  <br />
 *
 * 功能：
 *
 * @author : sunyl <br />
 * @Date : 2017年11月24日 上午9:37:03  <br />
 * @version : 1.1 <br />
 */
@Controller
@RequestMapping("logType")
public class LogBizTypeController extends BaseController<LogBizTypeVO, LogBizTypeModel> {
	@Autowired
	private ILogBizTypeService logBizTypeService;
	@RequestMapping("listPure")
	@ResponseBody
	public Result listPureForBizLogType(@RequestBody JSONObject jsonObject)   {
		LogBizTypeVO LogBizTypeVO = jsonObject.toJavaObject(LogBizTypeVO.class);
		Result result = new Result();
		List<LogBizTypeModel> list = logBizTypeService.list(convert(LogBizTypeVO));
		if (Utils.isNotNull(list) && list.size() > 0 ) {
			result.setRows(list);
			result.setStatus(ReturnStatusEnum.SUCCESS.getCode());
			result.setMsg(ReturnStatusEnum.SUCCESS.getDesc());
			result.setReturnCode(LogBizTypeCodeEnum.LOG_TYPE_QUERY_SUCCESS.getCode());
			result.setReturnMsg(LogBizTypeCodeEnum.LOG_TYPE_QUERY_SUCCESS.getDesc());
		} else {
			result = new Result();
			result.setStatus(ReturnStatusEnum.FAILURE.getCode());
			result.setMsg(ReturnStatusEnum.FAILURE.getDesc());
			result.setReturnCode(ReturnCodeEnum.NO_DATA.getCode());
			result.setReturnMsg(ReturnCodeEnum.NO_DATA.getDesc());
		}
		return result;
	}
	
	
}
